package com.yx.outSourcing.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

@Data
@ApiModel("外协人员DTO")
public class OutsourcingPersonDTO {

    @NotBlank(message = "申请单号不能为空")
    @ApiModelProperty(value = "申请单号", required = true, example = "41")
    private Long appId;          // 申请单号

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "姓名", required = true, example = "张三")
    private String userName;      // 姓名

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^\\d{17}[\\dXx]$", message = "身份证号格式不正确")
    @ApiModelProperty(value = "身份证号", required = true, example = "410511198708100613")
    private String idCard;        // 身份证号

    @NotBlank(message = "联系方式不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "联系方式", required = true, example = "17550893635")
    private String userPhone;     // 联系方式

    @NotBlank(message = "IC卡编号不能为空")
    @ApiModelProperty(value = "IC卡编号", required = true, example = "13718")
    private String icNo;          // IC卡编号

    @NotNull(message = "进厂时间不能为空")
    @ApiModelProperty(value = "进厂时间", required = true, example = "2025-08-01 08:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime entryTime; // 进厂时间

    @NotNull(message = "结束时间不能为空")
    @ApiModelProperty(value = "结束时间", required = true, example = "2025-12-31 17:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;   // 结束时间

    @NotBlank(message = "身份证正面照片不能为空")
    @ApiModelProperty(value = "身份证正面照片URL", required = true, example = "/photos/id_front_1.jpg")
    private String idCardFront;    // 身份证正面照片URL

    @NotBlank(message = "身份证反面照片不能为空")
    @ApiModelProperty(value = "身份证反面照片URL", required = true, example = "/photos/id_back_1.jpg")
    private String idCardBack;     // 身份证反面照片URL

    @NotBlank(message = "免冠照片不能为空")
    @ApiModelProperty(value = "2寸免冠照片URL", required = true, example = "/photos/portrait_1.jpg")
    private String portraitPhoto;  // 2寸免冠照片URL

    @ApiModelProperty(value = "新增人员", example = "李小胖")
    private String createdBy;      // 新增人员
}